package com.example.survey23.entity;


import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import sun.util.calendar.BaseCalendar;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;


@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("user")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private long id;

    @NotBlank(message = "昵称不能为空")
    private String username;

    private String avatar = "";

    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    private String email;

    private String password = "";

    private int status = 1;

    private LocalDateTime created ;

    private LocalDateTime lastLogin;

    // 用户的权限 —— 0 系统管理员 1 租户 2 普通用户
    private Integer permission = 2;

    private String tenantId = ""; // 用户所在租户的 id

    private String phone;

    private String sex;

    private String province;

    private Double fee;

}
